-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Witty export of functions with 16 parameters #2429
Fix Witty export of functions with 16 parameters #2429
Conversation
Instead of manually creating the very deeply nested type.
Allow usage of 17 parameters with typed exported functions.
Keep them as flat parameters instead, even if the return type needs to be lowered as well.
They were added to work-around the issue with function parameters that flattened to 16 flat types, and with the fix they are no longer needed.
d8d341c
to
e502be5
Compare
@@ -159,7 +159,7 @@ wasm-instrument = "0.4.0" | |||
wasmer = { package = "linera-wasmer", version = "4.3.6-linera.3", default-features = false } | |||
wasmer-compiler-singlepass = { package = "linera-wasmer-compiler-singlepass", version = "4.3.6-linera.3" } | |||
wasmparser = "0.101.1" | |||
wasmtime = "24.0.0" | |||
wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "58f82587462543e912b4edcbb247842711ba6415" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix we need hasn't been released yet. I added a TODO to update this once a release is available (they tend to release often, so hopefully soon).
Instead of pinning to the commit with the necessary fix.
Motivation
When exporting functions with a specific signature type (with parameters that are flattened to exactly 16 flat types and with a return type that flattens to more than one flat type) to a Wasm instance, Witty's
#[wit_export]
macro would incorrectly lower all parameters and return types to the type.This is different from what was specified in the specification.
Proposal
Don't lower the parameters of functions if they can be flattened into 16 flat types, even if the return type is lowered into the heap.
Test Plan
Ran tests manually to ensure that the
test_memory_run_application_with_dependency
passes without the dummy parameter that was introduced previously as a workaround before this fix.Release Plan
Links